<div class="goals">
  <% if @goals.empty? %>
    <div class="empty">
      No current goals found.
    </div>
  <% else %>
    <%= render :partial => "goal", :collection => @goals %>
  <% end %>
  
  <% unless @completed_goals.empty? %>
  <div class="entry completed_goals">
    <div class="top">
      Completed Goals
    </div>
    <div class="main">
      <table>
        <tr>
          <td style="width: 150px; padding-right: 10px; padding-bottom: 5px;">
            <br/>
          </td>
          <td style="width: 230px; padding-right: 10px; font-weight: bold;">
            Summary
          </td>
          <td style="width: 100px; padding-right: 10px; font-weight: bold; text-align: center;">
            Success
          </td>
          <td style="width: 100px; font-weight: bold;">
            Date
          </td>
        </tr>
      <% @completed_goals.each do |goal| %>
        <tr>
          <td style="width: 150px; padding-right: 10px; font-weight: bold; padding-bottom: 5px;">
            <%= link_to(h(goal.name), goals_url(:id => goal.id)) %><br/>
          </td>
          <td style="width: 230px; padding-right: 10px;">
            <%= h(goal.summary) %>
          </td>
          <td style="width: 100px; padding-right: 10px; text-align: center;">
            <%= (goal.progress.success.to_f / goal.progress.total * 100).ceil %>%
          </td>
          <td style="width: 100px;">
            <%= goal.created_at.strftime('%Y.%m.%d') %>
          </td>
        </tr>
      <% end %>
      </table>
    </div>
    <div class="bottom">
      <br class="clear"/>
    </div>
  </div>
  <% end %>

</div>